// API使用示例 - 展示新的文件夹结构

// 方式1: 从统一入口导入
import { 
  login, 
  getExamList, 
  createQuestion, 
  getGradingExams, 
  markCheating 
} from '@/api'

// 方式2: 按模块导入
import * as AuthAPI from '@/api/auth/auth'
import * as ExamAPI from '@/api/exam'
import * as QuestionAPI from '@/api/questions'
import * as GradingAPI from '@/api/grading'
import * as MonitoringAPI from '@/api/monitoring'
import * as RBACAPI from '@/api/rbac'

// 方式3: 导入单个函数
import { login } from '@/api/auth/auth'
import { getExamList } from '@/api/exam'
import { createQuestion } from '@/api/questions'
import { getGradingExams } from '@/api/grading'
import { markCheating } from '@/api/monitoring'

// 使用示例
export const exampleUsage = {
  // 认证
  async login() {
    return await login({ username: 'user', password: 'pass' })
  },
  
  // 考试相关
  async getExams() {
    return await ExamAPI.getExamList({ page: 1, size: 10 })
  },
  
  // 题目管理
  async createNewQuestion() {
    return await QuestionAPI.createQuestion({
      title: '新题目',
      type: 'multiple_choice',
      options: ['A', 'B', 'C', 'D'],
      correctAnswer: 'A',
      score: 5
    })
  },
  
  // 批改管理
  async getGradingList() {
    return await GradingAPI.getGradingExams()
  },
  
  // 监控管理
  async reportCheating() {
    return await MonitoringAPI.markCheating({
      examId: 1,
      studentId: 1,
      reason: '切屏次数过多'
    })
  },
  
  // 权限管理
  async getUsers() {
    return await RBACAPI.getUsers({ page: 1, size: 20 })
  }
}
